import React, { Component } from 'react'
import { Tabs} from 'antd'
import Admin from './Admin/Admin'
import OtherUser from './OtherUser/OtherUser'
import { connect } from 'react-redux';
import * as actions from './store/action';
const { TabPane } = Tabs;
class Index extends Component {
    componentDidMount() {
        this.props.getAccountConfigDatasRequest();
    }
    render() {
        return (
            <>
                <Tabs>
                    <TabPane key='1' tab={`系统管理员`} >
                        <Admin
                            adminDatas={this.props.adminDatas}
                        />
                    </TabPane>
                    <TabPane key='2' tab={`普通用户`}>
                        <OtherUser
                            otherUserData={this.props.otherUserData}
                        />
                    </TabPane>
                </Tabs>
            </>
                
           
        )
    }
}

const mapStateToProps = (state) => ({
    adminDatas: state.accountConfig.adminDatas,
    otherUserData: state.accountConfig.otherUserData,

})
const mapDispatchToProps = (dispatch) => ({
    getAccountConfigDatasRequest() {
        dispatch(actions.getAccountConfigDatasRequest())
    },
})
export default connect(mapStateToProps, mapDispatchToProps)(Index);